package com.kczd.activity;

import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.kczd.client.R;
import com.kczd.util.SysApplication;

public class JiaActivity extends Activity implements View.OnClickListener{

    private View mView;
    private ImageView mFastCar,mAloneCar,mDriverCar;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_jia);

        SysApplication.getInstance().addActivity(this);
        initViews();
    }

    private void initViews() {
        mView=findViewById(R.id.view_v);
        mFastCar= (ImageView) findViewById(R.id.id_kuaiche);
        mAloneCar= (ImageView) findViewById(R.id.id_zhuanche);
        mDriverCar= (ImageView) findViewById(R.id.id_daijia);

        mView.setOnClickListener(this);
        mFastCar.setOnClickListener(this);
        mAloneCar.setOnClickListener(this);
        mDriverCar.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.view_v:
                finish();
                break;
            case R.id.id_zhuanche:
             startActivity(new Intent(JiaActivity.this,AloneCarActivity.class));
                this.finish();
                break;
            case R.id.id_kuaiche:
                startActivity(new Intent(JiaActivity.this,FastCarActivity.class));
                this.finish();
                break;
            case R.id.id_daijia:
                startActivity(new Intent(JiaActivity.this,DriverCarActivity.class));
                this.finish();
                break;
        }
    }
}
